<template>
  <div class="menu">
    <div class="left">
      <div class="img">
        <img src="/title/arrow.png" style="transform: rotate(180deg)" @click="back" />
      </div>
      <div class="img">
        <img src="/title/arrow.png" />
      </div>
    </div>
    <div class="right">
      <Input />
      <div class="img" style="margin-left: 40px" @click="gotoLogin">
        <img src="/title/login.png" />
      </div>
      <div class="img" style="margin-right: 30px" @click="gotoSetting">
        <img src="/title/setting.png" />
      </div>
      <div class="img" @click="minimizeWindow">
        <img src="/title/minimize.png" />
      </div>
      <div class="img" @click="maximizeWindow">
        <img src="/title/maximize.png" />
      </div>
      <div class="img" @click="closeWindow">
        <img src="/title/close.png" />
      </div>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router';
const router = useRouter();

function back() {}
function gotoLogin() {
  router.push({ name: 'Login' });
}
function gotoSetting() {
  router.push({ name: 'Setting' });
}
function minimizeWindow() {
  window.Title.miximize();
}
function maximizeWindow() {
  window.Title.maximize();
}
function closeWindow() {
  window.Title.closeWindow();
}
</script>

<style scoped lang="scss">
.menu {
  -webkit-app-region: drag;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
  padding: 0 20px;
  background-color: #fff;

  .img {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 35px;
    height: 35px;
    object-fit: contain;
    -webkit-app-region: no-drag;
    margin-right: 20px;
    border-radius: 3px;

    img {
      width: 25px;
      height: auto;
    }

    &:hover {
      background-color: rgba($color: #f2f2f7, $alpha: 1);
    }
  }

  .left {
    display: flex;
  }

  .right {
    display: flex;
  }
}
</style>
